hvm/vidirian: Avoid printing page_to_mfn(NULL) on error paths
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 9 Oct 2013 10:11:48 +0000 (12:11 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 9 Oct 2013 10:11:48 +0000 (12:11 +0200)
commitc56cdf93750fd978aebd69dc113f12cc770ff8e3
tree92104e99e9f635b4fdffe57e96d65533f57c2a04
parent839b966e3f587bbb1a0d954230fb3904330dccb6
hvm/vidirian: Avoid printing page_to_mfn(NULL) on error paths

While working in the viridian code, I noticed that 4cb6c4f4941

"x86/hvm: Use get_page_from_gfn() instead of get_gfn()/put_gfn."

introduced two error paths where page_to_mfn(NULL) would be formatted and
presented as a bad MFN.  This provides junk in the warning rather than
something useful.

These two codepaths are fixed up to match their counterpart in
wrmsr_hypervisor_regs()

While auditing the other changes from 4cb6c4f4941, I noticed a small
optimisation which could be made by changing the order of the validity checks
to remove 6 NULL pointer checks.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
xen/arch/x86/hvm/hvm.c
xen/arch/x86/hvm/viridian.c